<template>
  <div id="app">
    <p ref="hello">Hello</p>
    <p ref="hello">2022</p>
    <ul>
      <li v-for="item in arr" :key="item" ref="arrli">{{ item }}</li>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'App',
  data() {
    return {
      arr: ['a', 'b', 'c'],
    }
  },
  mounted() {
    console.log(this.$refs.hello) // 会覆盖，获取的是最后一个
    console.log(this.$refs.arrli) // 获取的是一组，所有的
  },
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
